package com.xf.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xf.common.core.entity.dmp.DmpAuthRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Set;

/**
 * @author JoeyLiu
 * @create 2022-04-20 16:39
 */
@Mapper
public interface DmpAuthRoleMapper extends BaseMapper<DmpAuthRole> {


    @SqlParser(filter = true)
    Set<Long> getUserRoleIds(Long userId);

    @SqlParser(filter = true)
    IPage<DmpAuthRole> pageWithCreatedUser(IPage<DmpAuthRole> page, String roleName, Integer state);

    DmpAuthRole getOneByName(@Param("name") String name);


}